﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Class.aspx.cs" Inherits="Jy123.Web.Manage.User.Gift.Class" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>礼物类别管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../../css/custom/jquery.ui.css" rel="stylesheet" type="text/css" />
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />

    <script src="../../js/jquery.js" type="text/javascript"></script>

    <script src="../../js/jquery.ui.js" type="text/javascript"></script>

    <script src="../../js/main.js" type="text/javascript"></script>

</head>
<body>
    <h4>
        <a href="#"><span>礼物类别管理</span></a></h4>
    <form id="form1" runat="server">
    <div class="register">
        <h4>
            增加分类</h4>
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
        DataSourceID="SqlDataSource1" CssClass="tblist">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                SortExpression="ID" Visible="False" />
            <asp:BoundField DataField="GiftClassName" HeaderText="分类名称" SortExpression="GName" />
            <asp:CommandField HeaderText="操作" ShowDeleteButton="True" ShowEditButton="True" ValidationGroup="gridView">
                <ControlStyle CssClass="btnsty" />
            </asp:CommandField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        DeleteCommand="DELETE FROM [Public_GiftClass] WHERE [ID] = @ID" InsertCommand="INSERT INTO [Public_GiftClass] ([GiftClassName]) VALUES (@GiftClassName)"
        SelectCommand="SELECT [ID], [GiftClassName] FROM [Public_GiftClass]" UpdateCommand="UPDATE [Public_GiftClass] SET [GiftClassName] = @GiftClassName WHERE [ID] = @ID">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="GiftClassName" Type="String" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="GiftClassName" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <div class="allform">
        <h5>
        </h5>
        <ul>
            <li class="b">增加：</li>
            <li>
                <asp:TextBox ID="ClassName" runat="server" ValidationGroup="input" CssClass="text"></asp:TextBox></li>
            <li>
                <asp:RequiredFieldValidator ID="RequireName" runat="server" ControlToValidate="ClassName"
                    Display="Dynamic" ErrorMessage="分类名称不能为空" ValidationGroup="input"></asp:RequiredFieldValidator></li>
            <li>
                <asp:Button ID="btnAlterClass" runat="server" Text="确定" OnClick="btnAlterClass_Click"
                    CssClass="button" ValidationGroup="input" /><asp:HiddenField ID="TxtclassID" runat="server"
                        Value="0" />
            </li>
        </ul>
    </div>
    </form>
</body>
</html>
